package com.teach.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.teach.dto.HotelOrderDTO;
import com.teach.entity.HotelRoomOrder;
import com.teach.mapper.HotelRoomOrderMapper;
import com.teach.service.HotelRoomOrderService;

@Service
public class HotelRoomOrderServiceImpl implements HotelRoomOrderService {
	
	@Autowired
	private HotelRoomOrderMapper mapper;
	
	@Override
	public List<HotelRoomOrder> listAll() {
		return mapper.selectAll();
	}

	@Override
	public HotelRoomOrder get(Long orderId) {
		return mapper.selectByPrimaryKey(orderId);
	}

	@Override
	public void add(HotelRoomOrder hotelRoomOrder) {
		mapper.insertSelective(hotelRoomOrder);
	}

	@Override
	public void update(HotelRoomOrder hotelRoomOrder) {
		mapper.updateByPrimaryKeySelective(hotelRoomOrder);
	}

	@Override
	public void delete(Long orderId) {
		mapper.deleteByPrimaryKey(orderId);
	}

	@Override
	public List<HotelOrderDTO> selectAll() {		
		return mapper.select();
	}

	@Override
	public List<HotelOrderDTO> listByuserName(String userName) {
		return mapper.selectByUserName(userName);
	}

	@Override
	public List<HotelOrderDTO> listByShopId(Long shopId) {
		return mapper.selectByshopId(shopId);
	}

}
